#
#
# Copyright (C) 2008, 2009 i9 Project Contributors(1)
#     All Rights Reserved.
#
# You may only modify and redistribute this under the terms of any of the
# following licenses(2): i9 License, MIT License
#
#
# (1) i9 Project Contributors are listed in the AUTHORS file and at
#     http://i9os.googlecode.com/svn/trunk/Documentation/AUTHORS - please extend this file,
#     not this notice.
# (2) Reproduced in the files in /Documentation/Licenses, and at:
#     http://i9os.googlecode.com/svn/trunk/Documentation/Licenses
# 
# As per the above licenses, removal of this notice is prohibited.
#
# -------------------------------------------------------------------------
#

default:
	@echo -e ''
	@echo "Welcome to the i9 Build Environment |"
	@echo "-------------------------------------"
	@echo -e ''
	@echo "The following functions are available in this Makefile:"
	@echo "* The fetch-genode-toolchain option downloads, unpacks and installs the Genode Toolchain, if necessary."
	@echo "* The fetch-gplheaders option downs and relocates several GPLed header files that may be necessary to compile some"
	@echo "  components."
	@echo "* kernel-config will launch the curses-based L4 kernel configuration tool."
	@echo "* kernel-build will attempt to build the L4 kernel."
	@echo "* l4ul-build will attempt to build the example L4 userland."
	@echo "* l4ul-build-without-comport will attempt to build the example L4 userland with a workaround to resolve Issue #1."
	@echo "* genodekit-build will attempt to build the GenodeKit Personality."
	@echo -e "* spawn-janitor will attempt to run \"make clean\" in various directories. Also attempts to remove back-up files" 
	@echo "  created by certain text editors. (The clean option also does this)."
	@echo "* package-l4ul-demos will attempt to collect and package the example L4 userland in a bzip2-compressed tarball."
	@echo -e ''

kernel-config:
	@cd BuildMk && pwd && make menuconfig

kernel-build:
	@cd BuildMk && pwd && make

l4ul-build:
	@cd BuildL4UL && pwd && make

l4ul-build-without-comport:
	@cd BuildL4UL && pwd ./configure  --without-comport && make clean && make

genodekit-build:
	@cd Personalities/GenodeKit/build.pistachio_x86 && pwd && make

spawn-janitor: 
	@bash Utilities/janitor.sh

fetch-genode-toolchain:
	@cd Utilities && ./Fetch-Genode-Toolchain x86

fetch-gplheaders:
	@cd Utilities && pwd && sh FetchGPLHeaders.sh

clean:
	@make spawn-janitor

package-l4ul-demos:
	@cd Utilities && pwd && make -f Teleporter package-l4ul-demos

